<extend name="Public/layout"/>
<block name="head">
<link rel="stylesheet" href="__PUBLIC__css/index.css">
<link rel="stylesheet" href="__PUBLIC__css/financial.css">
<script src="__PUBLIC__assets/better-scroll/bscroll.min.js"></script>
<script src="__PUBLIC__js/financial.js"></script>
</block>

<block name="main">
    <div class="switches">
        <ul class="switches-wrapper">
            <li <if condition="$_GET['val'] eq 1 || !$_GET['val']"> class="active" </if> onclick="switchButton(this,1)">热门推荐</li>
            <li <if condition="$_GET['val'] eq 2"> class="active" </if> onclick="switchButton(this,2)">精选平台</li>
        </ul>
    </div>
    <div class="tabs">
        <div class="nav-swiper-container">
            <div class="swiper-wrapper">
                <div class="swiper-slide active" onclick="comsort(1)">综合排序</div>
                <div class="swiper-slide" onclick="comsort(2)">首投返利</div>
                <div class="swiper-slide" onclick="comsort(3)">复投加息</div>
                <div class="swiper-slide" onclick="comsort(4)">多投多返</div>
            </div>
        </div>
    </div>
    <div class="block-tj">
        <ul class="tj-wrapper">
            <!--注意，不同平台有不同的返利模式-->
                <foreach name="platform" item="v">
                    <li class="tj-item">
                        <a href="/Home/Platform/platform_detail/plat_id/{$v.id}">
                            <div class="tj-item-left">
                                <div class="plat-logo-wrapper">
                                    <img src="{$v.pic}" alt="">
                                </div>
                                <if condition="$v.team_type eq 'CPA+CPS'">
                                    <div class="plat-tag-wrapper">
                                        <div class="plat-tag">
                                            <i class="icon-currency"></i>
                                            <span>首投返利</span>
                                        </div>
                                    </div>
                                    <div class="tag-msg">
                                        <p>返现{$v.user_award}元</p>
                                    </div>
                                <elseif condition="$v.team_type eq 'CPA' and $v.id neq 12"/>
                                    <div class="plat-tag-wrapper">
                                        <div class="plat-tag">
                                            <i class="icon-currency"></i>
                                            <span>首投返利</span>
                                        </div>
                                    </div>
                                    <div class="tag-msg">
                                        <p>返现{$v.user_award}元</p>
                                    </div>
                                <elseif condition="$v.id eq 12"/>
                                    <div class="plat-tag-wrapper">
                                        <div class="plat-tag">
                                            <span>首投返投资金额×{$v.user_roi}%</span>
                                        </div>
                                    </div>
                                    <div class="tag-msg">
                                        <p>投资{$v.sch_start_amount}返{$v.sch_user_roi}</p>
                                    </div>
                                <elseif condition="$v.team_type eq 'ROI'"/>

                                    <div class="plat-tag-wrapper">
                                        <div class="plat-tag">
                                            <span>返投资金额×{$v.user_roi}%</span>
                                        </div>
                                    </div>
                                    <div class="tag-msg">
                                        <p>投资{$v.sch_start_amount}返{$v.sch_user_roi}</p>
                                    </div>

                                </if>

                            </div>
                            <div class="tj-item-right">
                                <div class="plat-info-header">
                                    <h3 class="plat-name">{$v.name}</h3>
                                    <div class="plat-plan">{$v.plat_sch_count}个投资方案</div>
                                    <div class="tag-wrapper">
                                        <notempty name='v.background'><span class="tag">{$v.background}</span></notempty>
                                        <if condition="$v.deposit neq '暂无'">
                                            <span class="tag">{$v.deposit}</span>
                                        </if>
                                    </div>
                                </div>
                                <ul class="plat-info-body">
                                    <li>
                                        <div class="left">投资期限</div>
                                        <div class="right">{$v.deadline}</div>
                                    </li>
                                    <li>
                                        <div class="left">起投金额</div>
                                        <div class="right">{$v.start_amount}元</div>
                                    </li>
                                    <li>
                                        <div class="left">往期年化</div>
                                        <div class="right dc3838">{$v.yields}</div>
                                    </li>
                                </ul>
                            </div>
                        </a>
                         <if condition="$v.is_port eq 1">
                        <!--如果是一键投，显示下面的sign1-->
                        <div class="plat-sign1"></div>
                        <!--如果是跳转投，显示下面的sign2-->
                        <else/>
                        <div class="plat-sign2"></div>
                        </if>
                    </li>
                </foreach>
        </ul>
    </div>
</block>
<block name="js">
    <script type="text/javascript">
        function switchButton(obj,val) {
            $.post('{:U("Financial/financial")}',{val:val},function() {
                location.href="/Home/Financial/financial/val/"+val;
            });

        }


        function comsort(vals) {
            var sort = vals;
            var val = "{$_GET['val']}";
            $.post('{:U("Financial/sort")}',{sort:sort,val:val},function(res) {
                $('.tj-wrapper').html(res.platform)
                $('.swiper-slide').removeClass('active');
                $('.swiper-slide').eq(sort-1).addClass('active');
            });
        }

    </script>
</block>